Method And Portable Electronic Device For Changing Graphics Processing Resolution According to Scenario

ABSTRACT

The present disclosure provides example methods for changing graphics processing resolution according to a scenario. In one example, a first display scenario is determined as a scenario in which energy can be saved. Based on the determination, a graphics processing resolution of a graphics processor can be reduced. At least one target graphics frame in the first display scenario can be rendered by the graphics processor according to the reduced graphics processing resolution to obtain at least one target image frame. The at least one target image frame can be adapted according to screen display resolution, and the at least one adapted target image frame can be displayed. The present disclosure further provides a portable electronic device and a system for changing graphics processing resolution according to a scenario.

TECHNICAL FIELD

The present invention relates to the field of electronic technologies,and in particular, to a method and a system for changing graphicsprocessing resolution according to a scenario.

BACKGROUND

Currently, a graphics processing capability of a portable electronicdevice (portable electronic device) is becoming stronger, and large 3Dapplications such as 3D games are more widely used in the portableelectronic device. The applications need to heavily use a graphicsprocessing unit (Graphical Processing Unit, GPU) for calculation.

The GPU is a parallel computing unit that specially processes vectors,and runs in a pipeline manner. A 3D application transfers 3D model dataand map data to the GPU. The GPU completes fixed point positioning,combination, and shading, that is, connects vertices to form fragmentsand then completes complex computing such as rendering.

Complexity of a 3D model is one of key factors that determine GPU powerconsumption. In a 3D game, there are usually more than ten thousandvertices in a picture of the 3D game, and the vertices form thousands offragments. Inside each fragment, a color of each displayable pixel needsto be calculated point by point, thereby consuming large power.

How to reduce power consumption of a GPU in processing a 3D applicationis an urgent problem of the portable electronic device currently.

SUMMARY

Embodiments of the present invention provide a method and a portableelectronic device for changing display resolution according to ascenario, to reduce power consumption of a GPU in processing a 3Dapplication.

An embodiment of the present invention provides a method for changinggraphics processing resolution according to a scenario, including:

determining a first display scenario as a scenario in which energy canbe saved;

reducing graphics processing resolution of a graphics processing unit;

rendering, by the graphics processing unit, at least one target graphicsframe in the first display scenario according to the reduced graphicsprocessing resolution, to obtain at least one target image frame;

adapting the at least one target image frame according to screen displayresolution; and

displaying the at least one target image frame adapted.

Optionally, the determining a first display scenario as a scenario inwhich energy can be saved includes:

obtaining a first graphics frame sequence in the first display scenario;

calculating an eigenvalue of the first graphics frame sequence; and

determining a display scenario type of the first graphics frame sequenceaccording to the eigenvalue of the first graphics frame sequence, wherethe display scenario type includes a scenario in which a game is beingplayed or a scenario in which no game is being played, and the scenarioin which a game is being played is a scenario in which energy can besaved.

Optionally, in the method, the first graphics frame in the first modelsequence is used as a first target graphics frame in the first graphicsframe sequence to calculate an eigenvalue of the first target graphicsframe, and the eigenvalue of the first target graphics frame is used asthe eigenvalue of the first graphics frame sequence.

The calculating an eigenvalue of the first graphics frame sequenceincludes at least one of the following steps:

calculating a thread eigenvalue of the first target graphics frameaccording to a thread required for rendering the first target graphicsframe;

calculating a model eigenvalue of the first target graphics frameaccording to a model array of the first target graphics frame;

calculating an address eigenvalue of the first target frame according toa buffer address of a model included in the first target graphics frame;and

performing weighted summation on the thread eigenvalue, the modeleigenvalue, and the address eigenvalue, to obtain the eigenvalue of thefirst target graphics frame.

Optionally, the determining a to-be-displayed display scenario as ascenario in which energy can be saved includes:

obtaining a first graphics frame sequence in the first display scenario;

calculating an eigenvalue of the first graphics frame sequence; and

determining a display scenario type of the first graphics frame sequenceaccording to the eigenvalue of the first graphics frame sequence, wherethe display scenario type includes a rapidly changing scenario or aslowly changing scenario, and the rapidly changing scenario is ascenario in which energy can be saved.

Optionally, the determining a current display scenario as a scenario inwhich energy can be saved includes:

when a quantity of control instructions received in the first displayscenario within first time is greater than a first threshold,determining the first display scenario as a scenario in which energy canbe saved.

Optionally, the rendering, by the graphics processing unit, at least onegraphics frame in the first display scenario according to the reducedgraphics processing resolution includes:

setting a graphics processing global variable of the graphics processingunit according to the reduced graphics processing resolution; and

rendering the at least one target graphics frame according to thegraphics processing global variable.

Optionally, after the displaying the at least one target image frameadapted, the method further includes:

collecting a quantity of times that a user exits an application programafter the at least one target image frame is displayed, where theapplication program is an application program that generates the firstgraphics frame sequence; and

when the quantity of times is greater than a tolerance threshold,stopping executing the method provided in this embodiment of the presentinvention.

Another embodiment of the present invention provides a portableelectronic device, including:

a determining unit, configured to determine a first display scenario asa scenario in which energy can be saved;

a reduction unit, configured to reduce graphics processing resolution ofa graphics processing unit;

the graphics processing unit, configured to render at least one targetgraphics frame in the first display scenario according to the reducedgraphics processing resolution, to obtain at least one target imageframe;

an adaptation unit, configured to adapt the at least one target imageframe according to screen display resolution; and

a display unit, configured to display the at least one target imageframe adapted.

Optionally, the determining unit includes:

an obtaining module, configured to obtain a first graphics framesequence in the first display scenario;

a calculation module, configured to calculate an eigenvalue of the firstgraphics frame sequence; and

a determining module, configured to determine a display scenario type ofthe first graphics frame sequence according to the eigenvalue of thefirst graphics frame sequence, where the display scenario type includesa scenario in which a game is being played or a scenario in which nogame is being played, and the scenario in which a game is being playedis a scenario in which energy can be saved.

Optionally, the determining unit includes:

an obtaining module, configured to obtain a first graphics framesequence in the first display scenario;

a calculation module, configured to calculate an eigenvalue of the firstgraphics frame sequence; and

a determining module, configured to determine a display scenario type ofthe first graphics frame sequence according to the eigenvalue of thefirst graphics frame sequence, where the display scenario type includesa rapidly changing scenario or a slowly changing scenario, and therapidly changing scenario is a scenario in which energy can be saved.

Optionally, the determining unit is specifically configured to:

when a quantity of control instructions received in the first displayscenario within first time is greater than a first threshold, determinethe first display scenario as a scenario in which energy can be saved.

Optionally, the graphics processing unit includes:

a global variable setting module, configured to set a graphicsprocessing global variable of the graphics processing unit according tothe reduced graphics processing resolution; and

a rendering module, configured to render the at least one targetgraphics frame according to the graphics processing global variable.

Optionally, the portable electronic device further includes:

an enabling module, configured to enable or disable the determiningmodule by using a hardware switch or a soft switch.

Optionally, the enabling module is specifically configured to:

collect a quantity of times that a user exits an application programafter the display module displays the at least one target image frame,where the application program is an application program that generatesthe first graphics frame sequence; and

disable the determining module when the quantity of times is greaterthan a tolerance threshold.

Still another embodiment of the present invention provides a portableelectronic device, including a central processing unit, a graphicsprocessing unit, a display adapter circuit, and a display.

The central processing unit is configured to determine a first displayscenario as a scenario in which energy can be saved, and reduce graphicsprocessing resolution of the graphics processing unit.

The graphics processing unit is configured to render at least one targetgraphics frame in the first display scenario according to the reducedgraphics processing resolution, to obtain at least one target imageframe.

The display adapter circuit is configured to adapt the at least onetarget image frame according to display resolution of the display.

The display is configured to display the at least one target image frameadapted.

Optionally, the determining a first display scenario as a scenario inwhich energy can be saved includes:

obtaining a first graphics frame sequence in the first display scenario;

calculating an eigenvalue of the first graphics frame sequence; and

determining a display scenario type of the first graphics frame sequenceaccording to the eigenvalue of the first graphics frame sequence, wherethe display scenario type includes a scenario in which a game is beingplayed or a scenario in which no game is being played, and the scenarioin which a game is being played is a scenario in which energy can besaved.

Optionally, the first graphics frame in the first model sequence is usedas a first target graphics frame in the first graphics frame sequence tocalculate an eigenvalue of the first target graphics frame, and theeigenvalue of the first target graphics frame is used as the eigenvalueof the first graphics frame sequence.

The calculating an eigenvalue of the first graphics frame sequenceincludes at least one of the following steps:

calculating a thread eigenvalue of the first target graphics frameaccording to a thread required for rendering the first target graphicsframe;

calculating a model eigenvalue of the first target graphics frameaccording to a model array of the first target graphics frame;

calculating an address eigenvalue of the first target frame according toa buffer address of a model included in the first target graphics frame;and

performing weighted summation on the thread eigenvalue, the modeleigenvalue, and the address eigenvalue, to obtain the eigenvalue of thefirst target graphics frame.

Optionally, the determining a to-be-displayed display scenario as ascenario in which energy can be saved includes:

obtaining a first graphics frame sequence in the first display scenario;

calculating an eigenvalue of the first graphics frame sequence; and

determining a display scenario type of the first graphics frame sequenceaccording to the eigenvalue of the first graphics frame sequence, wherethe display scenario type includes a rapidly changing scenario or aslowly changing scenario, and the rapidly changing scenario is ascenario in which energy can be saved.

Optionally, the determining a current display scenario as a scenario inwhich energy can be saved includes:

when a quantity of control instructions received in the first displayscenario within first time is greater than a first threshold,determining the first display scenario as a scenario in which energy canbe saved.

Optionally, the graphics processing unit includes:

a global variable setting module, configured to set a graphicsprocessing global variable of the graphics processing unit according tothe reduced graphics processing resolution; and

a rendering module, configured to render the at least one targetgraphics frame according to the graphics processing global variable.

Optionally, the determining a first display scenario as a scenario inwhich energy can be saved includes:

determining, according to the enabling instruction, the first displayscenario as a scenario in which energy can be saved, where

the enabling instruction is used to enable or stop an operation ofdetermining the first display scenario as a scenario in which energy canbe saved;

the central processing unit is further configured to collect a quantityof times that a user exits an application program after the displaydisplays the at least one target image frame adapted, where theapplication program is an application program that generates the firstgraphics frame; and

when the quantity of times is greater than a tolerance threshold, anenabling instruction used to stop executing the operation of determiningthe first display scenario as a scenario in which energy can be saved isgenerated.

By means of the method and the portable electronic device provided inthe embodiments of the present invention, power consumption of aportable electronic device may be reduced when user experience of a 3Dapplication is not affected.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a flowchart of a method embodiment according to the presentinvention;

FIG. 2A is a flowchart of some steps in a method embodiment according tothe present invention;

FIG. 2B is a flowchart of some steps in another method embodimentaccording to the present invention;

FIG. 3 is a flowchart of some steps in another method embodimentaccording to the present invention;

FIG. 4 is a flowchart of some steps in still another method embodimentaccording to the present invention;

FIG. 5 is a schematic structural diagram of a portable electronic deviceaccording to an embodiment of the present invention;

FIG. 6 is a schematic structural diagram of a portable electronic deviceaccording to another embodiment of the present invention;

FIG. 7A is an example of a scenario in which a game is being played;

FIG. 7B is an example of a scenario in which no game is being played;

FIG. 8 is a schematic diagram of an overall architecture of a portableelectronic device; and

FIG. 9 is an example of a display picture.

DESCRIPTION OF EMBODIMENTS

The following describes specific implementations of the presentinvention in detail.

First, several terms appearing in this application document aredescribed.

Ordinal numbers such as “first” and “second” appearing in thisapplication are used only for distinguishing rather than limiting asequence, except those specifically representing a sequence withreference to context.

In this application document, “graphics frame” is data that describes astatic display picture, and the display picture presentsthree-dimensional space including at least one three-dimensional object.“Display scenario” is a sequence including at least one graphics frame,“model” is a model established for a three-dimensional object,“rendering” is a process of drawing the foregoing model as atwo-dimensional image, and “image frame” is a two-dimensional imageobtained by rendering.

Various embodiments of the present invention are usually implemented ina portable electronic device. As shown in FIG. 8, the electronic deviceincludes components such as an input unit, a processor unit, an outputunit, a communications unit, a storage unit, and a peripheral unit.These components communicate with each other by using one or more buses.A person skilled in the art may understand that a structure of theelectronic device shown in the figure does not constitute a limitationon the present invention. The structure may be a bus structure, or maybe a star structure, or may include more or fewer components than thoseshown in the figure, or combine some parts, or have different partsarrangements. In the implementations of the present invention, theelectronic device may be any mobile or portable electronic device,including but not limited to a mobile phone, a mobile computer, a tabletcomputer, a personal digital assistant (Personal Digital Assistant,PDA), a media player, a smart television, and a combination of theforegoing two or more items.

The input unit is configured to implement interaction between a user andthe electronic device and/or input information to the electronic device.For example, the input unit may receive digit or character informationthat the user enters, so as to generate signal input related to usersetting or function control. In a specific implementation of the presentinvention, the input unit may be a touch panel; or may be anotherhuman-machine interaction interface, such as a physical input key or amicrophone; or may be another external information capture apparatus,such as a camera. A touch panel, also referred to as a touchscreen, maycollect an operation action of touching or approaching performed by auser on the touch panel. For example, the user performs an operationaction on the touch panel or at a position close to the touch panel byusing any proper object or accessory such as a finger or a stylus, and acorresponding connecting apparatus is driven according to a presetprogram. Optionally, the touch panel may include two parts: a touchdetection apparatus and a touch controller. The touch detectionapparatus detects a touch operation of a user, converts the detectedtouch operation into an electrical signal, and transmits the electricalsignal to the touch controller. The touch controller receives theelectrical signal from the touch detection apparatus, converts theelectrical signal into contact coordinates, and then sends the contactcoordinates to a processing unit. The touch controller may furtherreceive and execute a command sent by the processing unit. In addition,the touch panel may be implemented by using multiple types such as aresistive type, a capacitive type, an infrared (Infrared) ray, and asurface acoustic wave. In another implementation of the presentinvention, the physical input key used by the input unit may include butis not limited to one or more of a physical keyboard, a function button(such as a volume control button or a switch button), a trackball, amouse, a joystick, or the like. An input unit in a form of a microphonemay collect a voice that the user or an environment enters, and convertthe voice into a command that is in a form of an electric signal and maybe executed by the processing unit.

The input unit may also be a sensing component in various types. Forexample, a Hall component is configured to detect a physical quantity ofthe electronic device, such as a force, a torque, a pressure, a stress,a position, a displacement, a speed, an acceleration, an angle, anangular velocity, a quantity of revolutions, a rotational speed, and atime at which a working status changes, and convert the physicalquantity into an electric quantity to perform detection and control.Other sensing components may further include a gravity sensor, atri-axis accelerometer, a gyroscope, and the like.

The processor unit, as a control center of the electronic device, isconnected to various parts of the entire electronic device by usingvarious interfaces and lines, and implements various functions of theelectronic device and/or processes data by running or executing asoftware program and/or module stored in the storage unit and invokingdata stored in the storage unit. The processor unit may include anintegrated circuit (Integrated Circuit, IC for short). For example, theprocessor unit may include a single packaged IC, or may include multipleconnected packaged ICs that have a same function or different functions.For example, the processor unit may include only a central processingunit (Central Processing Unit, CPU for short), or may be a combinationof a GPU, a digital signal processor (Digital Signal Processor, DSP forshort), and a control chip (for example, a baseband chip) in thecommunications unit. In the implementations of the present invention,the CPU may be a single computing core, or may include multiplecomputing cores.

The communications unit is configured to establish a communicationschannel, so that the electronic device connects to a remote server byusing the communications channel, and downloads media data from theremote server. The communications unit may include a communicationsmodule, such as a wireless local area network (Wireless Local AreaNetwork, wireless LAN for short) module, a Bluetooth module, and abaseband (Base Band) module, and a radio frequency (Radio Frequency, RFfor short) circuit that is corresponding to the communications moduleand that is configured to perform wireless local area networkcommunication, Bluetooth communication, infrared ray communicationand/or cellular communications system communication, such as widebandcode division multiple access (Wideband Code Division Multiple Access,W-CDMA for short) and/or high speed download packet access (High SpeedDownlink Packet Access, HSDPA for short). The communications module isconfigured to control communication between all the components in theelectronic device, and may support direct memory access (Direct MemoryAccess).

In different implementations of the present invention, eachcommunications module in the communications unit usually appears in aform of an integrated circuit chip (Integrated Circuit Chip), and may beselectively combined without a need to include all communicationsmodules and corresponding antenna groups. For example, thecommunications unit may include only a baseband chip, a radio frequencychip, and a corresponding antenna, so as to provide a communicationfunction in a cellular communications system. The electronic device mayconnect to a cellular network (Cellular Network) or the Internet(Internet) via a wireless communications connection established by thecommunications unit, for example, by using wireless local area networkaccess or WCDMA access. In some optional implementations of the presentinvention, the communications module, such as the baseband module, inthe communications unit may be integrated into the processor unit,typically, such as APQ+MDM platforms provided by Qualcomm (Qualcomm).

The radio frequency circuit is configured to receive and sendinformation, or receive and send a signal during a call. For example,after receiving downlink information from a base station, the radiofrequency circuit sends the downlink information of the base station tothe processing unit for processing; and further, sends designed uplinkdata to the base station. Usually, the radio frequency circuit includesa well-known circuit used to perform these functions, and the well-knowncircuit includes but is not limited to an antenna system, a radiofrequency transceiver, one or more amplifiers, a tuner, one or moreoscillators, a digital signal processor, a codec (Codec) chipset, asubscriber identity module (SIM) card, a memory, and the like. Inaddition, the radio frequency circuit may further communicate with anetwork and another device by means of wireless communication. Thewireless communication may use any communications standard or protocol,including but not limited to GSM (Global System of Mobile communication,Global System for Mobile Communications), GPRS (General Packet RadioService, General Packet Radio Service), CDMA (Code Division MultipleAccess, Code Division Multiple Access), WCDMA (Wideband Code DivisionMultiple Access, Wideband Code Division Multiple Access), High SpeedUplink Packet Access technology (High Speed Uplink Packet Access,HSUPA), LTE (Long Term Evolution, Long Term Evolution), email, SMS(Short Messaging Service, Short Messaging Service), or the like.

The output unit includes but is not limited to an image output unit anda voice output unit. The image output unit is configured to output atext, a picture, and/or a video. The image output unit may include adisplay panel, for example, a display panel configured in a form of anLCD (Liquid Crystal Display, liquid crystal display), an OLED (OrganicLight-Emitting Diode, organic light-emitting diode), a field emissiondisplay (field emission display, FED for short), or the like.Alternatively, the image output unit may include a reflective display,for example, an electrophoretic (electrophoretic) display, or a displayusing an interferometric modulation of light (Interferometric Modulationof Light) technology. The image output unit may include a single displayor multiple displays in different sizes. In a specific implementation ofthe present invention, the touch panel used by the foregoing input unitmay be simultaneously used as the display panel of the output unit. Forexample, after detecting a gesture operation of touching or approachingon the touch panel, the touch panel transmits the gesture operation tothe processing unit to determine a touch event type, and then theprocessing unit provides corresponding visual output on the displaypanel according to the touch event type. In FIG. 8, the input unit andthe output unit serve as two independent parts to implement input andoutput functions of the electronic device. However, in some embodiments,the touch panel and the display panel may be integrated to implement theinput and output functions of the electronic device. For example, theimage output unit may display various graphical user interfaces(Graphical User Interface, GUI for short) as virtual control components,including but not limited to a window, a scroll bar, an icon, and aclipboard, so that a user performs an operation in a touch manner.

The image output unit includes a filter and an amplifier, configured tofilter and amplify a video output by the processing unit. The audiooutput unit includes a digital-to-analog converter, configured toconvert an audio signal, output by the processing unit, from a digitalformat to an analog format.

The storage unit may be configured to store a software program and amodule, and the processing unit executes various functional applicationsof the electronic device and implements data processing by running thesoftware program and the module that are stored in the storage unit. Thestorage unit mainly includes a program storage area and a data storagearea. The program storage area may store an operating system and anapplication program required by at least one function, such as a soundplayback program and an image playback program. The data storage areamay store data (such as audio data or a phonebook) created according touse of the electronic device, and the like. In a specific implementationof the present invention, the storage unit may include a volatilememory, such as a nonvolatile random access memory (Nonvolatile RandomAccess Memory, NVRAM for short), a phase change random access memory(Phase Change RAM, PRAM for short), or a magnetoresistive random accessmemory (Magetoresistive RAM, MRAM for short), and may further include anonvolatile memory, such as at least one magnetic disk storage device,an electrically erasable programmable read-only memory (ElectricallyErasable Programmable Read-Only Memory, EEPROM for short), or a flashmemory device, such as an NOR flash memory (NOR flash memory) or an NANDflash memory (NAND flash memory). The nonvolatile memory stores anoperating system and an application program executed by the processingunit. The processing unit loads a running program and data from thenonvolatile memory into a memory and stores digital content in a massivestorage apparatus. The operating system includes various componentsand/or drives that are configured to control and manage a conventionalsystem task, such as memory management, storage device control, or powermanagement, and facilitate communication between various software andhardware. The operating system may be the Android system of Google, theiOS system developed by Apple, the Windows operating system developed byMicrosoft, or the like; or may be an embedded operating system such asVxWorks.

The application program includes any application installed in theelectronic device, including but not limited to a browser, an email, aninstant messaging service, word processing, keyboard virtualization, awindow widget (Widget), encryption, digital copyright management, speechrecognition, voice duplication, positioning (for example, a functionprovided by the Global Positioning System), music playback, or the like.

A power supply is configured to supply power to different parts of theelectronic device to maintain running of the parts. Generally, the powersupply may be a built-in battery, for example, a common lithium-ionbattery or a nickel metal hydride battery, or may include an externalpower supply that directly supplies power to the electronic device, forexample, an AC adapter. In some implementations of the presentinvention, the power supply may further be defined in a wider scope; forexample, may further include a power management system, a power chargingsystem, a power failure detection circuit, a power converter orinverter, a power status indicator (such as a light-emitting diode), andany other components related to power generation, management, anddistribution of the electronic device.

The following embodiments of the present invention mainly relate to theprocessor unit and the image output unit of the foregoing portableelectronic device, and specifically, to a central processing unit (CPU)and a graphics processing unit (GPU).

In 3D graphics processing, 3D rendering is generally performed by usingthe graphics processing unit. In a process of the 3D graphicsprocessing, a graphics frame corresponding to a display picture needs tobe generated first. As shown in FIG. 9, a display picture presentsthree-dimensional space with boundaries, and the space includes variousthree-dimensional objects. Models of the various three-dimensionalobjects provide mathematical descriptions of geometric shapes of thesethree-dimensional objects, and define surface and inner properties ofthe three-dimensional objects, such as a color, transparency, andreflectivity. The graphics frame further defines a position relationshipbetween these three-dimensional objects and an environment such as alight source and mist in the display picture. Generation of a model isgenerally executed by code running in the central processing unit(Central Processing Unit, CPU).

A generated model is input to the GPU for rendering. As described above,the GPU is a parallel computing unit that specifically processesvectors, and runs in a pipeline manner. The GPU performs a calculationon model data and map data generated by a 3D application program. Theforegoing graphics frame describes three-dimensional space, but a screenof any electronic device is two-dimensional. Therefore, a model includedin the graphics frame needs to be projected onto a screen display plane.However, currently, texture patterns on surfaces of variousthree-dimensional objects are usually implemented in a map manner. Thatis, two-dimensional graphs that produce the texture patterns are mappedonto surfaces of the foregoing models by using a specific algorithm. TheGPU performs a calculation on the foregoing model data and map data in ahardware manner; completes fixed point positioning, combination, andshading, that is, connects vertices to form fragments and then completescomplex computing such as rendering; and finally outputs an image frame.

Usually, adaptation processing needs to be further performed on atwo-dimensional image fame output by the GPU, so as to display thetwo-dimensional image frame on a display. This processing process isgenerally executed by a specific circuit module. This module is referredto as a mobile display platform (Mobile Display Platform, MDP) in aSnapdragon (Snapdragon) platform of Qualcomm, and this module isreferred to as a display subsystem (Display Subsystem, DSS) in a Kirin(Kirin) platform of Hisilicon.

As shown in FIG. 1, an embodiment of the present invention provides amethod for changing graphics processing resolution according to ascenario, including the following steps.

100. Determine a first display scenario as a scenario in which energycan be saved.

The first display scenario herein is a sequence that is generated by anapplication program and that includes at least one display picture, forexample, may be a sequence that includes a series of display pictures ina 3D game. The so-called “scenario in which energy can be saved” is ascenario in which some operations may be performed to reduce powerconsumption of the scenario when the scenario is processed.

105. Reduce graphics processing resolution of a graphics processingunit.

110. The graphics processing unit (GPU) renders at least one targetgraphics frame in the first display scenario according to the reducedgraphics processing resolution, to obtain at least one target imageframe.

Herein, reducing the graphics processing resolution is settingresolution to be less than the graphics processing resolution currentlyused by the GPU. For example, the GPU performs rendering by using1920×1080 resolution currently, and may perform rendering by using1280×720 resolution after reduction. When performing rendering, the GPUperforms various calculations on a graphics frame according to specificresolution, for example, performs a calculation by using 1920×1080resolution. In this case, the GPU establishes a 1920×1080 coordinatesystem, and maps all models in a graphics frame into the coordinatesystem for calculation.

A specific way of reducing the image processing resolution may besetting a reduced resolution value, or setting a reduction percentageand multiplying the current resolution and the reduction percentage toperform subsequent processing.

120. Adapt the at least one target image frame according to screendisplay resolution.

As described above, an operation of this step is generally executed by aspecific circuit module, such as an MDP in a Snapdragon platform ofQualcomm or a DSS in a Kirin platform of Hisilicon. Usually, the circuitmodule performs only simple enlargement on the at least one target imageframe. For example, resolution of the at least one target image frame is1280×720, and the screen display resolution is 1920×1080. Therefore, thecircuit module enlarges the at least one target image frame to the1920×1080 resolution, so that the at least one target image frame canmatch the screen display resolution.

Certainly, the circuit module may also enlarge the at least one targetimage frame by using a complex algorithm. For example, interpolation isused, and in this way, an enlarged image may appear smoother.

As known by a person skilled in the art, step 120 may be implemented byusing a hardware circuit, and may also be implemented by using software.

130. Display the at least one target image frame adapted.

Specifically, as shown in FIG. 2A, in an embodiment, the followingmethod may be used to determine the first display scenario as a scenarioin which energy can be saved.

1010. Obtain a first graphics frame sequence in the first displayscenario.

The first graphics frame sequence herein is a sequence that includesgraphics frames corresponding to some display pictures or all displaypictures in the first display scenario. The sequence may be selected inmultiple manners. For example, graphics frames corresponding to thefirst N display pictures in the scenario are selected (N is a positiveinteger), or graphics frames corresponding to pictures to be displayedwithin a specific period of time (such as one second) are selected, orgraphics frames corresponding to several display pictures in thescenario are selected according to a specific rule, such as selecting adisplay picture whose serial number is an odd number. Certainly, aperson skilled in the art may also deduce another possible selectionmanner on the basis of teaching in the present invention, and this isnot limited in the present invention.

1020. Calculate an eigenvalue of the first graphics frame sequence.

In this embodiment, after the first graphics frame sequence is obtained,the first graphics frame in the first model sequence may be used as afirst target graphics frame in the first graphics frame sequence tocalculate an eigenvalue of the first target graphics frame, and theeigenvalue of the first target graphics frame is used as the eigenvalueof the first graphics frame sequence.

In a possible implementation, the calculating an eigenvalue of the firstgraphics frame sequence may include at least one of the following steps:

A1. Calculate a thread eigenvalue of the first target graphics frameaccording to a thread required for rendering the first target graphicsframe.

Because different threads may be required for displaying differentgraphics frames, the thread eigenvalue of the first target graphicsframe may be calculated according to the thread required for renderingthe first target graphics frame.

A2. Calculate a model eigenvalue of the first target graphics frameaccording to a model array of the first target graphics frame.

Each graphics frame corresponds to one model array, and a model array ofa graphics frame is an array of a quantity of model vertices included ina frame and a quantity of models. Therefore, the model eigenvalue of thetarget graphics frame may be calculated according to the model array ofthe first target graphics frame.

A3. Calculate an address eigenvalue of the first target frame accordingto a buffer address of a model included in the first target graphicsframe.

Different models included in a graphics frame have different bufferaddresses. Therefore, the address eigenvalue of the first targetgraphics frame may be calculated according to the buffer address of themodel included in the first target frame.

A4. Perform weighted summation on the thread eigenvalue, the modeleigenvalue, and the address eigenvalue, to obtain the eigenvalue of thetarget graphics frame.

After the thread eigenvalue of the target graphics frame, the modeleigenvalue of the target graphics frame, and the address eigenvalue ofthe target graphics frame are obtained, weighted summation may beperformed on the three eigenvalues to obtain the eigenvalue of thetarget graphics frame.

To obtain an eigenvalue of a scenario in which a game is being playedand an eigenvalue of a scenario in which no game is being played, aclustering base may be used to analyze an eigenvalue of a graphics framecorresponding to a scenario in which a game is being played and that isin an application program to obtain a game eigenvalue, and theclustering base may be used to analyze an eigenvalue of a graphics framecorresponding to a scenario in which no game is being played and that isin the application program to obtain a non-game eigenvalue. Then, thegame eigenvalue and the non-game eigenvalue are stored for subsequentinvoking.

1030. Determine a display scenario type of the first graphics framesequence according to the eigenvalue of the first graphics framesequence, where the display scenario type includes a scenario in which agame is being played or a scenario in which no game is being played, andthe scenario in which a game is being played is a scenario in whichenergy can be saved.

In this embodiment, the display scenario type includes the scenario inwhich a game is being played or the scenario in which no game is beingplayed, and an eigenvalue of a graphics frame sequence corresponding tothe scenario in which a game is being played is greatly different froman eigenvalue of a graphics frame sequence corresponding to the scenarioin which no game is being played. Therefore, the display scenario typeof the first graphics frame sequence may be determined according to theeigenvalue of the first graphics frame sequence. The scenario in which agame is being played is a scenario in which a user may perform anoperation and may obtain a game score. For examples of the scenario inwhich a game is being played and the scenario in which no game is beingplayed, refer to FIG. 7A. In FIG. 7A, the user may control a characterto move, so as to obtain a game score. This is the scenario in which agame is being played. FIG. 7B shows an entry screen of a gameapplication, and this is the scenario in which no game is being played.

In a possible implementation, a manner of determining the displayscenario type of the first graphics frame sequence according to theeigenvalue of the first graphics frame sequence is specifically:

calculating an absolute value of a difference between the eigenvalue ofthe target graphics frame and the game eigenvalue, and when the absolutevalue of the difference between the eigenvalue of the target graphicsframe and the game eigenvalue is less than a preset value, determiningthe display scenario type of the first graphics frame sequence as thescenario in which a game is being played; or

calculating an absolute value of a difference between the eigenvalue ofthe target graphics frame and the non-game eigenvalue, and when theabsolute value of the difference between the eigenvalue of the targetframe and the non-game eigenvalue is less than a preset value,determining the display scenario type of the first graphics framesequence as the scenario in which no game is being played.

Usually, in the scenario in which a game is being played, there are alarge quantity of models that relatively rapidly change, the GPUperforms a large quantity of calculations, and human eyes are lesssensitive to resolution of a rapidly changing picture. Therefore, ifgraphics rendering resolution is reduced to render the scenario in whicha game is being played, user experience is not affected while powerconsumption of the GPU is effectively reduced.

As shown in FIG. 2B, in another embodiment of the present invention, thefollowing method may be used to determine the first display scenario asa scenario in which energy can be saved.

1010. Obtain a first graphics frame sequence in the first displayscenario.

The first graphics frame sequence herein is a sequence that includesgraphics frames corresponding to some display pictures or all displaypictures in the first display scenario. The sequence may be selected inmultiple manners. For example, graphics frames corresponding to thefirst N display pictures in the scenario are selected (N is a positiveinteger), or graphics frames corresponding to pictures to be displayedwithin a specific period of time (such as one second) are selected, orgraphics frames corresponding to several display pictures in thescenario are selected according to a specific rule, such as selecting adisplay picture whose serial number is an odd number. Certainly, aperson skilled in the art may also deduce another possible selectionmanner on the basis of teaching in the present invention, and this isnot limited in the present invention.

1020. Calculate an eigenvalue of the first graphics frame sequence.

In this embodiment, similarity of all frames in the first graphics framesequence is calculated and used as the eigenvalue of the first graphicsframe sequence.

A method for calculating similarity of all graphics frames is obtaining,by means of comparison, percentages of different data in whole data inall the graphics frames and using a sum of the percentages as thesimilarity of all the graphics frames. A graphics frame generallyincludes model data, map data, environment data, and the like. Asdescribed above, these data represents shapes, positions, surfaceproperties, environments, and the like of various three-dimensionalobjects. Differences of these data are compared, the percentages of thedifferent data in the whole data in all the graphics frames are summed,and an obtained value may be used as the similarity of all the frames.

1031. Determine a display scenario type of the first graphics framesequence according to the eigenvalue of the first graphics framesequence, where the display scenario type includes a rapidly changingscenario or a slowly changing scenario, and the rapidly changingscenario is a scenario in which energy can be saved.

In an embodiment, if the foregoing similarity is less than a slow-changethreshold, a display scenario corresponding to the first graphics framesequence is determined as a slowly changing scenario, or otherwise, thedisplay scenario corresponding to the first graphics frame sequence isdetermined as a rapidly changing scenario.

In another embodiment, when the foregoing similarity is greater than arapid-change threshold, a display scenario corresponding to the firstgraphics frame sequence is determined as a rapidly changing scenario, orotherwise, the display scenario corresponding to the first graphicsframe sequence is determined as a slowly changing scenario.

Usually, the GPU performs a large quantity of calculations in a rapidlychanging scenario, and human eyes are less sensitive to resolution of arapidly changing picture. Therefore, if graphics rendering resolution isreduced to render the rapidly changing scenario, user experience is notaffected while power consumption of the GPU is effectively reduced.

As shown in FIG. 3, in still another embodiment of the presentinvention, step 100 includes:

1011. When a quantity of control instructions received in the firstdisplay scenario within first time is greater than a first threshold,determine the first display scenario as a scenario in which energy canbe saved.

The first time herein is a period of time in duration of the firstdisplay scenario, and a specific length may be selected according to arequirement, such as one second. A location at which the first time islocated in the first display scenario may also be selected according toa requirement, for example, may be a period of time at the verybeginning of the first display scenario. The control instruction is anoperation instruction for the first display scenario, for example,control of a character in a game, or rotation or movement of athree-dimensional object.

If the quantity of control instructions received within the first timeis less than the first threshold, it indicates that the user performsrelatively much control on the three-dimensional object in the firstdisplay scenario. In this way, the first display scenario relativelyrapidly changes, so that a measure of reducing power consumption may betaken.

As shown in FIG. 4, in an embodiment, step 120 described above includes:

1210. Set a graphics processing global variable of the graphicsprocessing unit according to the reduced graphics processing resolution.

When performing rendering, the GPU sets a series of global variables,such as a focal length, a size of a model array, and a buffer size.These global variables are related to the graphics processingresolution. After the graphics processing resolution is reduced, theseglobal variables are changed accordingly.

1220. Render the at least one target graphics frame according to thegraphics processing global variable.

After the foregoing global variable is changed, the GPU may render theat least one target graphics frame according to the reduced graphicsprocessing resolution. Specifically, the GPU includes a large quantityof computing units, and the GPU adjusts, according to a calculationquantity, a computing unit participating in a rendering calculation.After the global variable is set according to the reduced graphicsprocessing resolution, a quantity of computing units in the GPU thatparticipate in the rendering calculation is reduced, thereby reducingpower consumption.

By means of the method provided in this embodiment of the presentinvention, user experience of a 3D application program is not affectedwhile power consumption of the GPU is reduced.

In an embodiment of the present invention, a user may enable or disable,by using a hardware switch or a soft switch in a portable electronicdevice, execution of the method provided in this embodiment of thepresent invention.

In another embodiment, the execution of the method provided in thisembodiment of the present invention may be enabled or stoppedadaptively. For example, a quantity of times that the user exits anapplication program after step 130 is executed is collected, where theapplication program herein is an application program that generates thefirst graphics frame. When the quantity of times is greater than atolerance threshold, the execution of the method provided in thisembodiment of the present invention is stopped.

In an embodiment, the graphics processing resolution of the GPU may bereduced gradually, to prevent the user from sensing that the resolutionis changed suddenly.

As shown in FIG. 5, an embodiment of the present invention provides aportable electronic device, including a determining unit 501, areduction unit 502, a graphics processing unit 503, an adaptation unit504, and a display unit 505.

The determining unit 501 is configured to determine a first displayscenario as a scenario in which energy can be saved.

The first display scenario herein is a sequence that is generated by anapplication program and that includes at least one display picture, forexample, may be a sequence that includes a series of display pictures ina 3D game. The so-called “scenario in which energy can be saved” is ascenario in which some operations may be performed to reduce powerconsumption of the scenario when the scenario is processed.

The reduction unit 502 is configured to reduce graphics processingresolution of a graphics processing unit 503.

The graphics processing unit 503 is configured to render at least onetarget graphics frame in the first display scenario according to thereduced graphics processing resolution, to obtain at least one targetimage frame.

Herein, reducing the graphics processing resolution is settingresolution to be less than the graphics processing resolution currentlyused by the GPU. For example, the GPU performs rendering by using1920×1080 resolution currently, and may perform rendering by using1280×720 resolution after reduction. When performing rendering, the GPUperforms various calculations on a graphics frame according to specificresolution, for example, performs a calculation by using 1920×1080resolution. In this case, the GPU establishes a 1920×1080 coordinatesystem, and maps all models in a graphics frame into the coordinatesystem for calculation.

A specific way of reducing the image processing resolution may besetting a reduced resolution value, or setting a reduction percentageand multiplying the current resolution and the reduction percentage toperform subsequent processing.

The adaptation unit 504 is configured to adapt the at least one targetimage frame according to screen display resolution.

As described above, the unit is generally a specific circuit module,such as an MDP in a Snapdragon platform of Qualcomm or a DSS in a Kirinplatform of Hisilicon. Usually, the circuit module performs only simpleenlargement on the at least one target image frame. For example,resolution of the at least one target image frame is 1280×720, and thescreen display resolution is 1920×1080. Therefore, the circuit moduleenlarges the at least one target image frame to the 1920×1080resolution, so that the at least one target image frame can match thescreen display resolution.

Certainly, the circuit module may also enlarge the at least one targetimage frame by using a complex algorithm. For example, interpolation isused, and in this way, an enlarged image may appear smoother.

As known by a person skilled in the art, the adaptation unit 504 may beimplemented by using a hardware circuit, and may also be implemented byusing software.

The display unit 505 is configured to display the at least one targetimage frame adapted.

Specifically, as shown in FIG. 5, in an embodiment, the determining unit501 includes an obtaining module 5011, a calculation module 5012, and adetermining module 5013.

The obtaining module 5011 is configured to obtain a first graphics framesequence in the first display scenario.

The first graphics frame sequence herein is a sequence that includesgraphics frames corresponding to some display pictures or all displaypictures in the first display scenario. The sequence may be selected inmultiple manners. For example, graphics frames corresponding to thefirst N display pictures in the scenario are selected (N is a positiveinteger), or graphics frames corresponding to pictures to be displayedwithin a specific period of time (such as one second) are selected, orgraphics frames corresponding to several display pictures in thescenario are selected according to a specific rule, such as selecting adisplay picture whose serial number is an odd number. Certainly, aperson skilled in the art may also deduce another possible selectionmanner on the basis of teaching in the present invention, and this isnot limited in the present invention.

The calculation module 5012 is configured to calculate an eigenvalue ofthe first graphics frame sequence.

In this embodiment, after the first graphics frame sequence is obtained,the first graphics frame in the first model sequence may be used as atarget graphics frame in the first graphics frame sequence to calculatean eigenvalue of the target graphics frame, and the eigenvalue of thetarget graphics frame is used as the eigenvalue of the first graphicsframe sequence.

In a possible implementation, the calculating an eigenvalue of the firstgraphics frame sequence may include at least one of the followingmanners:

A1. Calculate a thread eigenvalue of the target graphics frame accordingto a thread required for rendering the target graphics frame.

Because different threads may be required for displaying differentgraphics frames, the thread eigenvalue of the target graphics frame maybe calculated according to the thread required for rendering the targetgraphics frame.

A2. Calculate a model eigenvalue of the target graphics frame accordingto a model array of the target graphics frame.

Each graphics frame corresponds to one model array, and a model array ofa graphics frame is an array of a quantity of model vertices included ina frame and a quantity of models. Therefore, the model eigenvalue of thetarget graphics frame may be calculated according to the model array ofthe target graphics frame.

A3. Calculate an address eigenvalue of the target graphics frameaccording to a buffer address of a model included in the target graphicsframe.

Different models included in a graphics frame have different bufferaddresses. Therefore, the address eigenvalue of the target graphicsframe may be calculated according to the buffer address of the modelincluded in the target frame.

A4. Perform weighted summation on the thread eigenvalue, the modeleigenvalue, and the address eigenvalue, to obtain the eigenvalue of thetarget graphics frame.

After the thread eigenvalue of the target graphics frame, the modeleigenvalue of the target graphics frame, and the address eigenvalue ofthe target graphics frame are obtained, weighted summation may beperformed on the three eigenvalues to obtain the eigenvalue of thetarget graphics frame.

To obtain an eigenvalue of a scenario in which a game is being playedand an eigenvalue of a scenario in which no game is being played, aclustering base may be used to analyze an eigenvalue of a graphics framecorresponding to a scenario in which a game is being played and that isin an application program to obtain a game eigenvalue, and theclustering base may be used to analyze an eigenvalue of a graphics framecorresponding to a scenario in which no game is being played and that isin the application program to obtain a non-game eigenvalue. Then, thegame eigenvalue and the non-game eigenvalue are stored for subsequentinvoking.

The determining module 5013 is configured to determine a displayscenario type of the first graphics frame sequence according to theeigenvalue of the first graphics frame sequence. The display scenariotype includes a scenario in which a game is being played or a scenarioin which no game is being played, and the scenario in which a game isbeing played is a scenario in which energy can be saved.

In this embodiment, the display scenario type includes the scenario inwhich a game is being played or the scenario in which no game is beingplayed, and an eigenvalue of a graphics frame sequence corresponding tothe scenario in which a game is being played is greatly different froman eigenvalue of a graphics frame sequence corresponding to the scenarioin which no game is being played. Therefore, the display scenario typeof the first graphics frame sequence may be determined according to theeigenvalue of the first graphics frame sequence. The scenario in which agame is being played is a scenario in which a user may perform anoperation and may obtain a game score. For examples of the scenario inwhich a game is being played and the scenario in which no game is beingplayed, refer to FIG. 7A and FIG. 7B. In FIG. 7A, the user may control acharacter to move, so as to obtain a game score. This is the scenario inwhich a game is being played. FIG. 7B shows an entry screen of a gameapplication, and this is the scenario in which no game is being played.

In a possible implementation, a manner of determining the displayscenario type of the first graphics frame sequence according to theeigenvalue of the first graphics frame sequence is specifically:

calculating an absolute value of a difference between the eigenvalue ofthe target graphics frame and the game eigenvalue, and when the absolutevalue of the difference between the eigenvalue of the target graphicsframe and the game eigenvalue is less than a preset value, determiningthe display scenario type of the first graphics frame sequence as thescenario in which a game is being played; or

calculating an absolute value of a difference between the eigenvalue ofthe target graphics frame and the non-game eigenvalue, and when theabsolute value of the difference between the eigenvalue of the targetframe and the non-game eigenvalue is less than a preset value,determining the display scenario type of the first graphics framesequence as the scenario in which no game is being played.

Usually, in the scenario in which a game is being played, there are alarge quantity of models that relatively rapidly change, the GPUperforms a large quantity of calculations, and human eyes are lesssensitive to resolution of a rapidly changing picture. Therefore, ifgraphics rendering resolution is reduced to render the scenario in whicha game is being played, user experience is not affected while powerconsumption of the GPU is effectively reduced.

As shown in FIG. 5, in another embodiment of the present invention, thedetermining unit 501 includes an obtaining module 5011, a calculationmodule 5012, and a determining module 5013.

The obtaining module 5011 is configured to obtain a first graphics framesequence in the first display scenario.

The first graphics frame sequence herein is a sequence that includesgraphics frames corresponding to some display pictures or all displaypictures in the first display scenario. The sequence may be selected inmultiple manners. For example, graphics frames corresponding to thefirst N display pictures in the scenario are selected (N is a positiveinteger), or graphics frames corresponding to pictures to be displayedwithin a specific period of time (such as one second) are selected, orgraphics frames corresponding to several display pictures in thescenario are selected according to a specific rule, such as selecting adisplay picture whose serial number is an odd number. Certainly, aperson skilled in the art may also deduce another possible selectionmanner on the basis of teaching in the present invention, and this isnot limited in the present invention.

The calculation module 5012 is configured to calculate an eigenvalue ofthe first graphics frame sequence.

In this embodiment, similarity of all frames in the first graphics framesequence is calculated and used as the eigenvalue of the first graphicsframe sequence.

A method for calculating similarity of all graphics frames is obtaining,by means of comparison, percentages of different data in whole data inall the graphics frames and using a sum of the percentages as thesimilarity of all the graphics frames. A graphics frame generallyincludes model data, map data, environment data, and the like. Asdescribed above, these data represents shapes, positions, surfaceproperties, environments, and the like of various three-dimensionalobjects. Differences of these data are compared, the percentages of thedifferent data in the whole data in all the graphics frames are summed,and an obtained value may be used as the similarity of all the frames.

The determining module 5013 is configured to determine a displayscenario type of the first graphics frame sequence according to theeigenvalue of the first graphics frame sequence. The display scenariotype includes a rapidly changing scenario or a slowly changing scenario,and the rapidly changing scenario is a scenario in which energy can besaved.

In an embodiment, if the foregoing similarity is less than a slow-changethreshold, a display scenario corresponding to the first graphics framesequence is determined as a slowly changing scenario, or otherwise, thedisplay scenario corresponding to the first graphics frame sequence isdetermined as a rapidly changing scenario.

In another embodiment, when the foregoing similarity is greater than arapid-change threshold, a display scenario corresponding to the firstgraphics frame sequence is determined as a rapidly changing scenario, orotherwise, the display scenario corresponding to the first graphicsframe sequence is determined as a slowly changing scenario.

Usually, the GPU performs a large quantity of calculations in a rapidlychanging scenario, and human eyes are less sensitive to resolution of arapidly changing picture. Therefore, if graphics rendering resolution isreduced to render the rapidly changing scenario, user experience is notaffected while power consumption of the GPU is effectively reduced.

In still another embodiment of the present invention, the determiningunit 501 is specifically configured to:

when a quantity of control instructions received in the first displayscenario within first time is greater than a first threshold, determinethe first display scenario as a scenario in which energy can be saved.

The first time herein is a period of time in duration of the firstdisplay scenario, and a specific length may be selected according to arequirement, such as one second. A location at which the first time islocated in the first display scenario may also be selected according toa requirement, for example, may be a period of time at the verybeginning of the first display scenario. The control instruction is anoperation instruction for the first display scenario, for example,control of a character in a game, or rotation or movement of athree-dimensional object.

If the quantity of control instructions received within the first timeis less than the first threshold, it indicates that the user performsrelatively much control on the three-dimensional object in the firstdisplay scenario. In this way, the first display scenario relativelyrapidly changes, so that a measure of reducing power consumption may betaken.

As shown in FIG. 5, in an embodiment, the graphics processing unit 503includes a global variable setting module 5031 and a rendering module5032.

The global variable setting module 5031 is configured to set a graphicsprocessing global variable of the graphics processing unit according tothe reduced graphics processing resolution.

When performing rendering, the GPU sets a series of global variables,such as a focal length, a size of a model array, and a buffer size.These global variables are related to the graphics processingresolution. After the graphics processing resolution is reduced, theseglobal variables are changed accordingly.

The rendering module 5032 is configured to render the at least onetarget graphics frame according to the graphics processing globalvariable.

After the foregoing global variable is changed, the GPU may render theat least one target graphics frame according to the reduced graphicsprocessing resolution. Specifically, the GPU includes a large quantityof computing units, and the GPU adjusts, according to a calculationquantity, a computing unit participating in a rendering calculation.After the global variable is set according to the reduced graphicsprocessing resolution, a quantity of computing units in the GPU thatparticipate in the rendering calculation is reduced, thereby reducingpower consumption.

The portable electronic device provided in this embodiment of thepresent invention does not affect user experience of a 3D applicationprogram while reducing power consumption of the GPU.

In an embodiment of the present invention, the portable electronicdevice further includes an enabling module 506, configured to enable ordisable the determining module 501 by using a hardware switch or a softswitch.

In another embodiment, the enabling module 506 is specificallyconfigured to adaptively disable the determining module 501; forexample, collect a quantity of times that a user exits an applicationprogram after the display module 505 displays the at least one targetimage frame, where the application program herein is an applicationprogram that generates the first graphics frame sequence; and disablethe determining module 501 when the quantity of times is greater than atolerance threshold.

In an embodiment, the reduction unit 502 may gradually reduce thegraphics processing resolution of the GPU, to prevent the user fromsensing that the resolution is changed suddenly.

As shown in FIG. 6, an embodiment of the present invention furtherprovides a portable electronic device, including a central processingunit 601, a graphics processing unit 602, a display adapter circuit 603,and a display 604.

The central processing unit 601 is configured to determine a firstdisplay scenario as a scenario in which energy can be saved, and reducegraphics processing resolution of the graphics processing unit 602.

The first display scenario herein is a sequence that is generated by anapplication program and that includes at least one display picture, forexample, may be a sequence that includes a series of display pictures ina 3D game. The so-called “scenario in which energy can be saved” is ascenario in which some operations may be performed to reduce powerconsumption of the scenario when the scenario is processed.

Herein, reducing the graphics processing resolution is settingresolution to be less than the graphics processing resolution currentlyused by the GPU. For example, the GPU performs rendering by using1920×1080 resolution currently, and may perform rendering by using1280×720 resolution after reduction. When performing rendering, the GPUperforms various calculations on a graphics frame according to specificresolution, for example, performs a calculation by using 1920×1080resolution. In this case, the GPU establishes a 1920×1080 coordinatesystem, and maps all models in a graphics frame into the coordinatesystem for calculation.

A specific way of reducing the image processing resolution may besetting a reduced resolution value, or setting a reduction percentageand multiplying the current resolution and the reduction percentage toperform subsequent processing.

The graphics processing unit 602 is configured to render at least onetarget graphics frame in the first display scenario according to thereduced graphics processing resolution, to obtain at least one targetimage frame.

The central processing unit 601 and the graphics processing unit 602 maybe separately located in two chips, or may be integrated in one chip.

The display adapter circuit 603 is configured to adapt the at least onetarget image frame according to display resolution of the display 604.

As described above, the circuit is generally a specific circuit module,such as an MDP in a Snapdragon platform of Qualcomm or a DSS in a Kirinplatform of Hisilicon. Usually, the circuit module performs only simpleenlargement on the at least one target image frame. For example,resolution of the at least one target image frame is 1280×720, and thescreen display resolution is 1920×1080. Therefore, the circuit moduleenlarges the at least one target image frame to the 1920×1080resolution, so that the at least one target image frame can match thescreen display resolution.

Certainly, the circuit may also enlarge the at least one target imageframe by using a complex algorithm. For example, interpolation is used,and in this way, an enlarged image may appear smoother.

The display 604 is configured to display the at least one target imageframe adapted.

The display herein may be a liquid crystal display, an organiclight-emitting diode (AMOLED) display, or the like, and is not limitedin this embodiment of the present invention.

Specifically, as shown in FIG. 2A, in an embodiment, the determining afirst display scenario as a scenario in which energy can be savedincludes the following steps.

1010. Obtain a first graphics frame sequence in the first displayscenario.

The first graphics frame sequence herein is a sequence that includesgraphics frames corresponding to some display pictures or all displaypictures in the first display scenario. The sequence may be selected inmultiple manners. For example, graphics frames corresponding to thefirst N display pictures in the scenario are selected (N is a positiveinteger), or graphics frames corresponding to pictures to be displayedwithin a specific period of time (such as one second) are selected, orgraphics frames corresponding to several display pictures in thescenario are selected according to a specific rule, such as selecting adisplay picture whose serial number is an odd number. Certainly, aperson skilled in the art may also deduce another possible selectionmanner on the basis of teaching in the present invention, and this isnot limited in the present invention.

1020. Calculate an eigenvalue of the first graphics frame sequence.

In this embodiment, after the first graphics frame sequence is obtained,the first graphics frame in the first model sequence may be used as atarget graphics frame in the first graphics frame sequence to calculatean eigenvalue of the target graphics frame, and the eigenvalue of thetarget graphics frame is used as the eigenvalue of the first graphicsframe sequence.

In a possible implementation, the calculating an eigenvalue of the firstgraphics frame sequence may include at least one of the followingmanners:

A1. Calculate a thread eigenvalue of the target graphics frame accordingto a thread required for rendering the target graphics frame.

Because different threads may be required for displaying differentgraphics frames, the thread eigenvalue of the target graphics frame maybe calculated according to the thread required for rendering the targetgraphics frame.

A2. Calculate a model eigenvalue of the target graphics frame accordingto a model array of the target graphics frame.

Each graphics frame corresponds to one model array, and a model array ofa graphics frame is an array of a quantity of model vertices included ina frame and a quantity of models. Therefore, the model eigenvalue of thetarget graphics frame may be calculated according to the model array ofthe target graphics frame.

A3. Calculate an address eigenvalue of the target graphics frameaccording to a buffer address of a model included in the target graphicsframe.

Different models included in a graphics frame have different bufferaddresses. Therefore, the address eigenvalue of the target graphicsframe may be calculated according to the buffer address of the modelincluded in the target frame.

A4. Perform weighted summation on the thread eigenvalue, the modeleigenvalue, and the address eigenvalue, to obtain the eigenvalue of thetarget graphics frame.

After the thread eigenvalue of the target graphics frame, the modeleigenvalue of the target graphics frame, and the address eigenvalue ofthe target graphics frame are obtained, weighted summation may beperformed on the three eigenvalues to obtain the eigenvalue of thetarget graphics frame.

To obtain an eigenvalue of a scenario in which a game is being playedand an eigenvalue of a scenario in which no game is being played, aclustering base may be used to analyze an eigenvalue of a graphics framecorresponding to a scenario in which a game is being played and that isin an application program to obtain a game eigenvalue, and theclustering base may be used to analyze an eigenvalue of a graphics framecorresponding to a scenario in which no game is being played and that isin the application program to obtain a non-game eigenvalue. Then, thegame eigenvalue and the non-game eigenvalue are stored for subsequentinvoking.

1030. Determine a display scenario type of the first graphics framesequence according to the eigenvalue of the first graphics framesequence, where the display scenario type includes a scenario in which agame is being played or a scenario in which no game is being played, andthe scenario in which a game is being played is a scenario in whichenergy can be saved.

In this embodiment, the display scenario type includes the scenario inwhich a game is being played or the scenario in which no game is beingplayed, and an eigenvalue of a graphics frame sequence corresponding tothe scenario in which a game is being played is greatly different froman eigenvalue of a graphics frame sequence corresponding to the scenarioin which no game is being played. Therefore, the display scenario typeof the first graphics frame sequence may be determined according to theeigenvalue of the first graphics frame sequence. The scenario in which agame is being played is a scenario in which a user may perform anoperation and may obtain a game score. For examples of the scenario inwhich a game is being played and the scenario in which no game is beingplayed, refer to FIG. 7A and FIG. 7B. In FIG. 7A, the user may control acharacter to move, so as to obtain a game score. This is the scenario inwhich a game is being played. FIG. 7B shows an entry screen of a gameapplication, and this is the scenario in which no game is being played.

In a possible implementation, a manner of determining the displayscenario type of the first graphics frame sequence according to theeigenvalue of the first graphics frame sequence is specifically:

calculating an absolute value of a difference between the eigenvalue ofthe target graphics frame and the game eigenvalue, and when the absolutevalue of the difference between the eigenvalue of the target graphicsframe and the game eigenvalue is less than a preset value, determiningthe display scenario type of the first graphics frame sequence as thescenario in which a game is being played; or

calculating an absolute value of a difference between the eigenvalue ofthe target graphics frame and the non-game eigenvalue, and when theabsolute value of the difference between the eigenvalue of the targetframe and the non-game eigenvalue is less than a preset value,determining the display scenario type of the first graphics framesequence as the scenario in which no game is being played.

Usually, in the scenario in which a game is being played, there are alarge quantity of models that relatively rapidly change, the GPUperforms a large quantity of calculations, and human eyes are lesssensitive to resolution of a rapidly changing picture. Therefore, ifgraphics rendering resolution is reduced to render the scenario in whicha game is being played, user experience is not affected while powerconsumption of the GPU is effectively reduced.

As shown in FIG. 2B, in another embodiment of the present invention, thedetermining a first display scenario as a scenario in which energy canbe saved includes the following steps.

1010. Obtain a first graphics frame sequence in the first displayscenario.

The first graphics frame sequence herein is a sequence that includesgraphics frames corresponding to some display pictures or all displaypictures in the first display scenario. The sequence may be selected inmultiple manners. For example, graphics frames corresponding to thefirst N display pictures in the scenario are selected (N is a positiveinteger), or graphics frames corresponding to pictures to be displayedwithin a specific period of time (such as one second) are selected, orgraphics frames corresponding to several display pictures in thescenario are selected according to a specific rule, such as selecting adisplay picture whose serial number is an odd number. Certainly, aperson skilled in the art may also deduce another possible selectionmanner on the basis of teaching in the present invention, and this isnot limited in the present invention.

1020. Calculate an eigenvalue of the first graphics frame sequence.

In this embodiment, similarity of all frames in the first graphics framesequence is calculated and used as the eigenvalue of the first graphicsframe sequence.

A method for calculating similarity of all graphics frames is obtaining,by means of comparison, percentages of different data in whole data inall the graphics frames and using a sum of the percentages as thesimilarity of all the graphics frames. A graphics frame generallyincludes model data, map data, environment data, and the like. Asdescribed above, these data represents shapes, positions, surfaceproperties, environments, and the like of various three-dimensionalobjects. Differences of these data are compared, the percentages of thedifferent data in the whole data in all the graphics frames are summed,and an obtained value may be used as the similarity of all the frames.

1031. Determine a display scenario type of the first graphics framesequence according to the eigenvalue of the first graphics framesequence, where the display scenario type includes a rapidly changingscenario or a slowly changing scenario, and the rapidly changingscenario is a scenario in which energy can be saved.

In an embodiment, if the foregoing similarity is less than a slow-changethreshold, a display scenario corresponding to the first graphics framesequence is determined as a slowly changing scenario, or otherwise, thedisplay scenario corresponding to the first graphics frame sequence isdetermined as a rapidly changing scenario.

In another embodiment, when the foregoing similarity is greater than arapid-change threshold, a display scenario corresponding to the firstgraphics frame sequence is determined as a rapidly changing scenario, orotherwise, the display scenario corresponding to the first graphicsframe sequence is determined as a slowly changing scenario.

Usually, the GPU performs a large quantity of calculations in a rapidlychanging scenario, and human eyes are less sensitive to resolution of arapidly changing picture. Therefore, if graphics rendering resolution isreduced to render the rapidly changing scenario, user experience is notaffected while power consumption of the GPU is effectively reduced.

In still another embodiment of the present invention, the determining afirst display scenario as a scenario in which energy can be savedincludes:

when a quantity of control instructions received in the first displayscenario within first time is greater than a first threshold,determining the first display scenario as a scenario in which energy canbe saved.

The first time herein is a period of time in duration of the firstdisplay scenario, and a specific length may be selected according to arequirement, such as one second. A location at which the first time islocated in the first display scenario may also be selected according toa requirement, for example, may be a period of time at the verybeginning of the first display scenario. The control instruction is anoperation instruction for the first display scenario, for example,control of a character in a game, or rotation or movement of athree-dimensional object.

If the quantity of control instructions received within the first timeis less than the first threshold, it indicates that the user performsrelatively much control on the three-dimensional object in the firstdisplay scenario. In this way, the first display scenario relativelyrapidly changes, so that a measure of reducing power consumption may betaken.

As shown in FIG. 6, in an embodiment, the graphics processing unit 602includes a global variable setting module 6021 and a rendering module6022.

The global variable setting module 6021 is configured to set a graphicsprocessing global variable of the graphics processing unit according tothe reduced graphics processing resolution.

When performing rendering, the GPU sets a series of global variables,such as a focal length, a size of a model array, and a buffer size.These global variables are related to the graphics processingresolution. After the graphics processing resolution is reduced, theseglobal variables are changed accordingly.

The rendering module 6022 is configured to render the at least onetarget graphics frame according to the graphics processing globalvariable.

After the foregoing global variable is changed, the GPU may render theat least one target graphics frame according to the reduced graphicsprocessing resolution. Specifically, the GPU includes a large quantityof computing units, and the GPU adjusts, according to a calculationquantity, a computing unit participating in a rendering calculation.After the global variable is set according to the reduced graphicsprocessing resolution, a quantity of computing units in the GPU thatparticipate in the rendering calculation is reduced, thereby reducingpower consumption.

The portable electronic device provided in this embodiment of thepresent invention does not affect user experience of a 3D applicationprogram while reducing power consumption of the GPU.

In an embodiment of the present invention, the central processing unit601 may further receive an enabling instruction, and the determining afirst display scenario as a scenario in which energy can be savedincludes:

determining, according to the enabling instruction, the first displayscenario as a scenario in which energy can be saved.

The enabling instruction herein includes an instruction used to enableor stop an operation of determining the first display scenario as ascenario in which energy can be saved. The enabling instruction may beentered by a user by using a hardware switch or a soft switch, or may bean enabling instruction generated adaptively. For example, a quantity oftimes that the user exits an application program after the displaydisplays the at least one target image frame adapted is collected, wherethe application program herein is an application program that generatesthe first graphics frame. When the quantity of times is greater than atolerance threshold, an enabling instruction used to stop executing theoperation of determining the first display scenario as a scenario inwhich energy can be saved is generated.

In an embodiment, the central processing unit 601 may gradually reducethe graphics processing resolution of the GPU, to prevent the user fromsensing that the resolution is changed suddenly.

In addition, a combination may be made between various technologies,systems, apparatuses, methods separately described in the foregoingembodiments and technical features separately described in theembodiments, so as to form another module, method, apparatus, system,and technology that do not depart from the spirit and principle of thepresent invention. The module, method, apparatus, system, and technologythat are formed by means of a combination according to a record in theembodiments of the present invention shall fall within the protectionscope of the present invention.

Apparently, a person skilled in the art should understand that theforegoing units or steps of the present invention may be implemented bya common computing apparatus. The units or steps may be integrated in asingle computing apparatus or distributed in a network includingmultiple computing apparatuses. Optionally, the units or steps may beimplemented by using program code that a computing apparatus canexecute. Therefore, the units or steps may be stored in a storageapparatus and executed by the computing apparatus. Alternatively, theunits or steps are separately made into various circuit modules, ormultiple units or steps in the units or steps are made into a singlecircuit module for implementation. In this way, the present invention isnot limited to any specific combination of hardware and software.

The foregoing is merely examples of embodiments of the presentinvention, but is not intended to limit the protection scope of thepresent invention. Any modification, equivalent replacement, orimprovement made without departing from the spirit and principle of thepresent invention shall fall within the protection scope of the presentinvention.

1. A method for changing graphics processing resolution according to ascenario, comprising: determining a first display scenario as a scenarioin which energy can be saved; reducing graphics processing resolution ofa graphics processor based on the determination; rendering, by thegraphics processor, at least one target graphics frame in the firstdisplay scenario according to the reduced graphics processing resolutionto obtain at least one target image frame; adapting the at least onetarget image frame according to screen display resolution; anddisplaying the at least one adapted target image frame.
 2. The methodaccording to claim 1, wherein the determining a first display scenarioas a scenario in which energy can be saved comprises: obtaining a firstgraphics frame sequence in the first display scenario; calculating aneigenvalue of the first graphics frame sequence; and determining adisplay scenario type of the first graphics frame sequence according tothe eigenvalue of the first graphics frame sequence, wherein the displayscenario type comprises one of a scenario in which a game is beingplayed or a scenario in which no game is being played, and wherein thescenario in which a game is being played is a scenario in which energycan be saved.
 3. The method according to claim 2, wherein the firstgraphics frame in a first model sequence is used as a first targetgraphics frame in the first graphics frame sequence to calculate aneigenvalue of the first target graphics frame, and wherein theeigenvalue of the first target graphics frame is used as the eigenvalueof the first graphics frame sequence; and the calculating an eigenvalueof the first graphics frame sequence comprises at least one ofcalculating a thread eigenvalue of the first target graphics frameaccording to a thread required for rendering the first target graphicsframe; calculating a model eigenvalue of the first target graphics frameaccording to a model array of the first target graphics frame;calculating an address eigenvalue of the first target frame according toa buffer address of a model comprised in the first target graphicsframe; and performing weighted summation on the thread eigenvalue, themodel eigenvalue, and the address eigenvalue, to obtain the eigenvalueof the first target graphics frame.
 4. The method according to claim 1,wherein the determining a first display scenario as a scenario in whichenergy can be saved comprises: obtaining a first graphics frame sequencein the first display scenario; calculating an eigenvalue of the firstgraphics frame sequence; and determining a display scenario type of thefirst graphics frame sequence according to the eigenvalue of the firstgraphics frame sequence, wherein the display scenario type comprises arapidly changing scenario or a slowly changing scenario, and wherein therapidly changing scenario is a scenario in which energy can be saved. 5.The method according to claim 1, wherein the determining a first displayscenario as a scenario in which energy can be saved comprises:determining the first display scenario as a scenario in which energy canbe saved in response to receiving a quantity of control instructionsgreater than a first threshold in the first display scenario within afirst time period.
 6. The method according to claim 1, wherein therendering, by the graphics processor, at least one graphics frame in thefirst display scenario according to the reduced graphics processingresolution comprises: setting a graphics processing global variable ofthe graphics processor according to the reduced graphics processingresolution; and rendering the at least one target graphics frameaccording to the graphics processing global variable.
 7. The methodaccording to claim 1, wherein after the displaying the at least onetarget image frame adapted, the method further comprises: collecting aquantity of times that a user exits an application program after the atleast one target image frame is displayed, wherein the applicationprogram is an application program that generates the first graphicsframe sequence; and when the quantity of times is greater than atolerance threshold, stopping execution of determining a first displayscenario as a scenario in which energy can be saved. 8-14. (canceled)15. A portable electronic device, comprising at least one centralprocessor, a graphics processor, a display adapter circuit, and adisplay, wherein the at least one central processor is configured to:determine a first display scenario as a scenario in which energy can besaved; and reduce graphics processing resolution of the graphicsprocessor based on the determination; the graphics processor isconfigured to render at least one target graphics frame in the firstdisplay scenario according to the reduced graphics processing resolutionto obtain at least one target image frame; the display adapter circuitis configured to adapt the at least one target image frame according todisplay resolution of the display; and the display is configured todisplay the at least one adapted target image frame.
 16. The portableelectronic device according to claim 15, wherein the determining a firstdisplay scenario as a scenario in which energy can be saved comprises:obtaining a first graphics frame sequence in the first display scenario;calculating an eigenvalue of the first graphics frame sequence; anddetermining a display scenario type of the first graphics frame sequenceaccording to the eigenvalue of the first graphics frame sequence,wherein the display scenario type comprises one of a scenario in which agame is being played or a scenario in which no game is being played, andwherein the scenario in which a game is being played is a scenario inwhich energy can be saved.
 17. The portable electronic device accordingto claim 16, wherein the first graphics frame in a first model sequenceis used as a first target graphics frame in the first graphics framesequence to calculate an eigenvalue of the first target graphics frame,and wherein the eigenvalue of the first target graphics frame is used asthe eigenvalue of the first graphics frame sequence; and the calculatingan eigenvalue of the first graphics frame sequence comprises at leastone of calculating a thread eigenvalue of the first target graphicsframe according to a thread required for rendering the first targetgraphics frame; calculating a model eigenvalue of the first targetgraphics frame according to a model array of the first target graphicsframe; calculating an address eigenvalue of the first target frameaccording to a buffer address of a model comprised in the first targetgraphics frame; and performing weighted summation on the threadeigenvalue, the model eigenvalue, and the address eigenvalue, to obtainthe eigenvalue of the first target graphics frame.
 18. The portableelectronic device according to claim 15, wherein the determining a firstdisplay scenario as a scenario in which energy can be saved comprises:obtaining a first graphics frame sequence in the first display scenario;calculating an eigenvalue of the first graphics frame sequence; anddetermining a display scenario type of the first graphics frame sequenceaccording to the eigenvalue of the first graphics frame sequence,wherein the display scenario type comprises a rapidly changing scenarioor a slowly changing scenario, and wherein the rapidly changing scenariois a scenario in which energy can be saved.
 19. The portable electronicdevice according to claim 15, wherein the determining a first displayscenario as a scenario in which energy can be saved comprises:determining the first display scenario as a scenario in which energy canbe saved in response to receiving a quantity of control instructionsgreater than a first threshold in the first display scenario within afirst time period.
 20. The portable electronic device according to claim15, wherein the graphics processor comprises: a global variable settingmodule, the global variable setting module configured to set a graphicsprocessing global variable of the graphics processor according to thereduced graphics processing resolution; and a rendering module, therendering module configured to render the at least one target graphicsframe according to the graphics processing global variable.
 21. Theportable electronic device according to claim 15, wherein thedetermining a first display scenario as a scenario in which energy canbe saved comprises: determining, according to an enabling instruction,the first display scenario as a scenario in which energy can be saved,wherein: the enabling instruction is used to enable or stop an operationof determining the first display scenario as a scenario in which energycan be saved; and the at least one central processor is furtherconfigured to: collect a quantity of times that a user exits anapplication program after the display displays the at least one targetimage frame adapted, wherein the application program is an applicationprogram that generates the first graphics frame; and generate theenabling instruction used to stop executing the operation of determiningthe first display scenario as a scenario in which energy can be savingin response to determining that the collected quantity of times isgreater than a tolerance threshold.
 22. A system, comprising at leastone central processor and a graphics processor, wherein the at least onecentral processor is configured to: determine a first display scenarioas a scenario in which energy can be saved; and reduce graphicsprocessing resolution of the graphics processor in response to thedetermination; and the graphics processor is configured to render atleast one target graphics frame in the first display scenario accordingto the reduced graphics processing resolution to obtain at least onetarget image frame.
 23. The system according to claim 22, wherein thedetermining a first display scenario as a scenario in which energy canbe saved comprises: obtaining a first graphics frame sequence in thefirst display scenario; calculating an eigenvalue of the first graphicsframe sequence; and determining a display scenario type of the firstgraphics frame sequence according to the eigenvalue of the firstgraphics frame sequence, wherein the display scenario type comprises oneof a scenario in which a game is being played or a scenario in which nogame is being played, and wherein the scenario in which a game is beingplayed is a scenario in which energy can be saved.
 24. The systemaccording to claim 23, wherein a first graphics frame in a first modelsequence is used as a first target graphics frame in the first graphicsframe sequence to calculate an eigenvalue of the first target graphicsframe, and wherein the eigenvalue of the first target graphics frame isused as the eigenvalue of the first graphics frame sequence; and thecalculating an eigenvalue of the first graphics frame sequence comprisesat least one of: calculating a thread eigenvalue of the first targetgraphics frame according to a thread required for rendering the firsttarget graphics frame; calculating a model eigenvalue of the firsttarget graphics frame according to a model array of the first targetgraphics frame; calculating an address eigenvalue of the first targetframe according to a buffer address of a model comprised in the firsttarget graphics frame; and performing weighted summation on the threadeigenvalue, the model eigenvalue, and the address eigenvalue, to obtainthe eigenvalue of the first target graphics frame.
 25. The systemaccording to claim 22, wherein the determining a first display scenarioas a scenario in which energy can be saved comprises: obtaining a firstgraphics frame sequence in the first display scenario; calculating aneigenvalue of the first graphics frame sequence; and determining adisplay scenario type of the first graphics frame sequence according tothe eigenvalue of the first graphics frame sequence, wherein the displayscenario type comprises a rapidly changing scenario or a slowly changingscenario, and wherein the rapidly changing scenario is a scenario inwhich energy can be saved.
 26. The system according to claim 22, whereinthe determining a first display scenario as a scenario in which energycan be saved comprises: determining the first display scenario as ascenario in which energy can be saved in response to receiving aquantity of control instructions greater than a first threshold in thefirst display scenario within a first time period.
 27. The systemaccording to claim 22, wherein the determining a first display scenarioas a scenario in which energy can be saved comprises: determining,according to an enabling instruction, the first display scenario as ascenario in which energy can be saved, wherein the enabling instructionis used to enable or stop an operation of determining the first displayscenario as a scenario in which energy can be saved; and the at leastone central processor is further configured to: collect a quantity oftimes that a user exits an application program after the displaydisplays the at least one target image frame adapted, wherein theapplication program is an application program that generates the firstgraphics frame; and generate the enabling instruction used to stopexecuting the operation of determining the first display scenario as ascenario in which energy can be saving in response to determining thatthe collected quantity of times is greater than a tolerance threshold.